import { Component, OnInit, Inject, forwardRef, ViewChild } from '@angular/core';
import { AppComponent } from '../../../app.component';
import { path } from '../../../path.config';
import { masterService } from '../../../../lib/master.service';
import { ExchangeCardGridComponent } from './exchange-card-grid/exchange-card-grid.component';

@Component({
    selector: 'exchange-card-management',
    templateUrl: './exchange-card-management.component.html',
    styleUrls: ['./exchange-card-management.component.css']
})
export class ExchangeCardManagementComponent implements OnInit {
    @ViewChild('ExchangeCardGrid') ExchangeCardGrid: ExchangeCardGridComponent;

    public filter = {
        pageSize: '10',
        pageIndex: '1',
        name: '',
        goodsName: '',
        channel:'',
        generateTime:'',
        generator: ''
    }

    constructor(private _masterService: masterService) { }

    ngOnInit() { }

    // 过滤grid数据
    selectListItem() {
        this.ExchangeCardGrid.onChangeTable(this.filter, '1');
    }

    openModal() {
        this._masterService
            .openCardBatchinfo
            .emit();
    }

    cardTemplateAddFunc() {
        this.ExchangeCardGrid.onChangeTable(this.filter, '1');
    }
}
